import type { BaseResponseData } from '../trademark/type'

//定义Spu模型类型
export interface SpuRecord {
  id?: number
  spuName: string
  description: string
  category3Id: number
  tmId: number
  spuSaleAttrList: null | SaleAttrResponseData[]
  spuImageList: null | SpuImageData[]
}

export type SpuRecords = SpuRecord[]
//定义Spu接口返回值类型
export interface SpuResponseData extends BaseResponseData {
  data: {
    records: SpuRecords
    total: number
    size: number
    current: number
    searchCount: boolean
    pages: number
  }
}
//定义spu图像类型
export interface SpuImageData {
  id?: number
  createTime?: string
  updateTime?: string
  spuId?: number
  imgName?: string
  imgUrl?: string
  name?: string
  url?: string
}

//定义获取spu图像列表返回值类型
export interface SpuImageResponseData extends BaseResponseData {
  data: SpuImageData[]
}

//定义spu下的销售属性类型
export interface SpuSaleAttrData {
  baseSaleAttrId: number
  id?: number
  isChecked: string
  saleAttrName: string
  saleAttrValueName: string
  spuId?: number
}
//定义销售属性类型
export interface SaleAttrResponseData {
  baseSaleAttrId: number
  id?: number
  saleAttrName: string
  spuId?: number
  spuSaleAttrValueList: SpuSaleAttrData[]
  isEdit?: boolean
  saleAttrValueName?: string
}
//定义返回的Spu销售属性列表类型
export interface SpuSaleAttrResponseData extends BaseResponseData {
  data: SaleAttrResponseData[]
}

//定义基本销售属性类型
export interface SaleAttrData {
  id: number
  name: string
}
//定义基本销售属性返回类型
export interface BaseSaleAttrData extends BaseResponseData {
  data: SaleAttrData[]
}
